//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IFileHandler.h>
///	@path	~/src/database/store/
///	@date	2007/12/03
///	@desc	Handles file loading & store, by give corresponding extension.

#pragma once

#include "xeres.h"

#include "object/IObject.h"

#include "database/database.h"

namespace xeres {

	// forward declaration
	class IFile;
	class IData;

	/*!
		\class	IFileHandler
		\brief	Interface of file handler.
	*/
	class IFileHandler : public IObject
	{
	public:

		/// \ctor
		IFileHandler( void );

		/// \dtor
		virtual ~IFileHandler( void );

		DECL_IOBJECT_INTERFACE( IFileHandler , IObject );

	public:

	//@ interface

		/*!
			\brief		Loads a file into corresponding data entry.
		*/
		virtual RefPass<IData> LoadFile( const Key& ext , RefWeak<IFile> file ) = 0;

		/*!
			\brief		Loads a file & try to identify it, handles it while handler can.
		*/
	};

} // namespace xeres
